//
//  Category.m
//  Megatlon
//
//  Created by Leandro Milmanda on 6/6/12.
//  Copyright 2012 www.lemil.com.ar. All rights reserved.
//
#import "NSDate+Utils.h"

@implementation NSDate(Utils)


-(NSDate *) toLocalTime
{
    NSTimeZone *tz = [NSTimeZone defaultTimeZone];
    NSInteger seconds = [tz secondsFromGMTForDate: self];
    return [NSDate dateWithTimeInterval: seconds sinceDate: self];
}

-(NSDate *) toGlobalTime
{
    NSTimeZone *tz = [NSTimeZone defaultTimeZone];
    NSInteger seconds = -[tz secondsFromGMTForDate: self];
    return [NSDate dateWithTimeInterval: seconds sinceDate: self];
}

@end